<?php
/**
 * Created by PhpStorm.
 * User: xuewl
 * Date: 2017/12/11
 * Time: 23:32
 */
namespace app\user\validate;
use \think\Validate;

class User extends Validate
{
    protected $rule = [
        'openid' => 'require',
        'unionid' => 'alphaDash|max:100',
        'nickname' => 'require|max:100',
        'avatar' => 'max:200',
        'role' => 'require|in:0,1,2',
        'point' => 'number',
        'qrcode' => 'max:200',
        'mobile' => 'length:11',
        'sex' => '',
        'customer_id' => 'number|max:11',
        'distributor_id' => 'number|max:11',
        'goods_num' => 'number|max:11',
        'product_num' => 'number|max:11',
        'status' => '',
        'apply_status' => '',
        'weight' => 'float',
    ];


    protected $scene = [
        'add' => ['openid','unionid'],
        'edit' => [],
    ];
}
